<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateDocumentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_idDocument}" for="idDocument" />
                    <h:inputText id="idDocument" value="#{documentController.selected.idDocument}" title="#{bundle.CreateDocumentTitle_idDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_idDocument}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_nomDocument}" for="nomDocument" />
                    <h:inputText id="nomDocument" value="#{documentController.selected.nomDocument}" title="#{bundle.CreateDocumentTitle_nomDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_nomDocument}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_auteurDocument}" for="auteurDocument" />
                    <h:inputText id="auteurDocument" value="#{documentController.selected.auteurDocument}" title="#{bundle.CreateDocumentTitle_auteurDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_auteurDocument}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_tailleDocument}" for="tailleDocument" />
                    <h:inputText id="tailleDocument" value="#{documentController.selected.tailleDocument}" title="#{bundle.CreateDocumentTitle_tailleDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_tailleDocument}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_listeMotClesDocument}" for="listeMotClesDocument" />
                    <h:inputText id="listeMotClesDocument" value="#{documentController.selected.listeMotClesDocument}" title="#{bundle.CreateDocumentTitle_listeMotClesDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_listeMotClesDocument}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_dateCreation}" for="dateCreation" />
                    <h:inputText id="dateCreation" value="#{documentController.selected.dateCreation}" title="#{bundle.CreateDocumentTitle_dateCreation}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_dateCreation}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_dateMiseAjour}" for="dateMiseAjour" />
                    <h:inputText id="dateMiseAjour" value="#{documentController.selected.dateMiseAjour}" title="#{bundle.CreateDocumentTitle_dateMiseAjour}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_dateMiseAjour}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_lienDeTelechargement}" for="lienDeTelechargement" />
                    <h:inputText id="lienDeTelechargement" value="#{documentController.selected.lienDeTelechargement}" title="#{bundle.CreateDocumentTitle_lienDeTelechargement}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_lienDeTelechargement}"/>
                    <h:outputLabel value="#{bundle.CreateDocumentLabel_catDocument}" for="catDocument" />
                    <h:selectOneMenu id="catDocument" value="#{documentController.selected.catDocument}" title="#{bundle.CreateDocumentTitle_catDocument}" required="true" requiredMessage="#{bundle.CreateDocumentRequiredMessage_catDocument}">
                        <f:selectItems value="#{categorieDocumentController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{documentController.create}" value="#{bundle.CreateDocumentSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{documentController.prepareList}" value="#{bundle.CreateDocumentShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateDocumentIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
